import {Component} from "react";
//super 一定要传 props 吗？不传不行？
class A extends Component{
    constructor(props){
        super(props);
        this.statte = {
            name: "katy"
        }
    }

    changeUser(e){
        var name = this.state.name=="katy"?"win7":"katy";
        this.setState({
            name
        })
    }
    render(){
        return (
            React.createElement("div", null, 
                React.createElement("div", null, this.state.name), 
                React.createElement("div", null, 
                    React.createElement("button", {onClick: this.changeUser}, "change user")
                )
            )
        );
    }
}